import threading
from rest_framework.response import Response
from rest_framework.views import APIView

from DjangoRestAuth.publicApi import DocParam, get_parameter_dic, tid_maker
import os
from django.conf import settings
class getImgPaths(APIView):

    '''
    训练图片路径
    '''
    coreapi_fields = (
        # DocParam("epoch_range", description='轮询次数', required=True),#10
    )
    def get(self, request, *args, **kwargs):
        rootdir = settings.IMG_FILE_PATH
        list = os.listdir(rootdir)  # 获取文件名列表
        return Response({"path":rootdir,"list": list})
